﻿<Page
    x:Class="RemoteDataSample.Views.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:RemoteDataSample"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:viewModels="using:RemoteDataSample.ViewModels"
    mc:Ignorable="d">
    <Page.DataContext>
        <viewModels:MainViewModel/>
    </Page.DataContext>

    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

        <ListView ItemsSource="{Binding RemoteImages}" 
                  CanReorderItems="True" CanDragItems="True"
                  AllowDrop="True" Padding="40,40,40,80">
            <ListView.Header>
                <TextBlock Style="{StaticResource HeaderTextBlockStyle}" 
                           Margin="0,0,0,60">Images</TextBlock>
            </ListView.Header>
            <ListView.ItemTemplate>
                <DataTemplate>
                    <Grid Height="100" Width="400">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                        </Grid.ColumnDefinitions>
                        <Image Source="{Binding PathUri}"/>
                        <TextBlock FontSize="20" Text="{Binding Title}" 
                                   VerticalAlignment="Center" Margin="10"
                                   Grid.Column="1"
                                   Foreground="White" />
                    </Grid>
                </DataTemplate>
            </ListView.ItemTemplate>
        </ListView>

    </Grid>
</Page>
